{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 导入必要的库"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 载入数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "path2 = \"./Euro 2012 stats TEAM.csv\"      # Euro2012_stats.csv"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Team</th>\n",
       "      <th>Goals</th>\n",
       "      <th>Shots on target</th>\n",
       "      <th>Shots off target</th>\n",
       "      <th>Shooting Accuracy</th>\n",
       "      <th>% Goals-to-shots</th>\n",
       "      <th>Total shots (inc. Blocked)</th>\n",
       "      <th>Hit Woodwork</th>\n",
       "      <th>Penalty goals</th>\n",
       "      <th>Penalties not scored</th>\n",
       "      <th>...</th>\n",
       "      <th>Saves made</th>\n",
       "      <th>Saves-to-shots ratio</th>\n",
       "      <th>Fouls Won</th>\n",
       "      <th>Fouls Conceded</th>\n",
       "      <th>Offsides</th>\n",
       "      <th>Yellow Cards</th>\n",
       "      <th>Red Cards</th>\n",
       "      <th>Subs on</th>\n",
       "      <th>Subs off</th>\n",
       "      <th>Players Used</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Croatia</td>\n",
       "      <td>4</td>\n",
       "      <td>13</td>\n",
       "      <td>12</td>\n",
       "      <td>51.9%</td>\n",
       "      <td>16.0%</td>\n",
       "      <td>32</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>13</td>\n",
       "      <td>81.3%</td>\n",
       "      <td>41</td>\n",
       "      <td>62</td>\n",
       "      <td>2</td>\n",
       "      <td>9</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>9</td>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Czech Republic</td>\n",
       "      <td>4</td>\n",
       "      <td>13</td>\n",
       "      <td>18</td>\n",
       "      <td>41.9%</td>\n",
       "      <td>12.9%</td>\n",
       "      <td>39</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>9</td>\n",
       "      <td>60.1%</td>\n",
       "      <td>53</td>\n",
       "      <td>73</td>\n",
       "      <td>8</td>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "      <td>11</td>\n",
       "      <td>11</td>\n",
       "      <td>19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Denmark</td>\n",
       "      <td>4</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>50.0%</td>\n",
       "      <td>20.0%</td>\n",
       "      <td>27</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>10</td>\n",
       "      <td>66.7%</td>\n",
       "      <td>25</td>\n",
       "      <td>38</td>\n",
       "      <td>8</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>7</td>\n",
       "      <td>7</td>\n",
       "      <td>15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>England</td>\n",
       "      <td>5</td>\n",
       "      <td>11</td>\n",
       "      <td>18</td>\n",
       "      <td>50.0%</td>\n",
       "      <td>17.2%</td>\n",
       "      <td>40</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>22</td>\n",
       "      <td>88.1%</td>\n",
       "      <td>43</td>\n",
       "      <td>45</td>\n",
       "      <td>6</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>11</td>\n",
       "      <td>11</td>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>France</td>\n",
       "      <td>3</td>\n",
       "      <td>22</td>\n",
       "      <td>24</td>\n",
       "      <td>37.9%</td>\n",
       "      <td>6.5%</td>\n",
       "      <td>65</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>6</td>\n",
       "      <td>54.6%</td>\n",
       "      <td>36</td>\n",
       "      <td>51</td>\n",
       "      <td>5</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>11</td>\n",
       "      <td>11</td>\n",
       "      <td>19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Germany</td>\n",
       "      <td>10</td>\n",
       "      <td>32</td>\n",
       "      <td>32</td>\n",
       "      <td>47.8%</td>\n",
       "      <td>15.6%</td>\n",
       "      <td>80</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>10</td>\n",
       "      <td>62.6%</td>\n",
       "      <td>63</td>\n",
       "      <td>49</td>\n",
       "      <td>12</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>15</td>\n",
       "      <td>15</td>\n",
       "      <td>17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Greece</td>\n",
       "      <td>5</td>\n",
       "      <td>8</td>\n",
       "      <td>18</td>\n",
       "      <td>30.7%</td>\n",
       "      <td>19.2%</td>\n",
       "      <td>32</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>13</td>\n",
       "      <td>65.1%</td>\n",
       "      <td>67</td>\n",
       "      <td>48</td>\n",
       "      <td>12</td>\n",
       "      <td>9</td>\n",
       "      <td>1</td>\n",
       "      <td>12</td>\n",
       "      <td>12</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Italy</td>\n",
       "      <td>6</td>\n",
       "      <td>34</td>\n",
       "      <td>45</td>\n",
       "      <td>43.0%</td>\n",
       "      <td>7.5%</td>\n",
       "      <td>110</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>20</td>\n",
       "      <td>74.1%</td>\n",
       "      <td>101</td>\n",
       "      <td>89</td>\n",
       "      <td>16</td>\n",
       "      <td>16</td>\n",
       "      <td>0</td>\n",
       "      <td>18</td>\n",
       "      <td>18</td>\n",
       "      <td>19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Netherlands</td>\n",
       "      <td>2</td>\n",
       "      <td>12</td>\n",
       "      <td>36</td>\n",
       "      <td>25.0%</td>\n",
       "      <td>4.1%</td>\n",
       "      <td>60</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>12</td>\n",
       "      <td>70.6%</td>\n",
       "      <td>35</td>\n",
       "      <td>30</td>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>7</td>\n",
       "      <td>7</td>\n",
       "      <td>15</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Poland</td>\n",
       "      <td>2</td>\n",
       "      <td>15</td>\n",
       "      <td>23</td>\n",
       "      <td>39.4%</td>\n",
       "      <td>5.2%</td>\n",
       "      <td>48</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>6</td>\n",
       "      <td>66.7%</td>\n",
       "      <td>48</td>\n",
       "      <td>56</td>\n",
       "      <td>3</td>\n",
       "      <td>7</td>\n",
       "      <td>1</td>\n",
       "      <td>7</td>\n",
       "      <td>7</td>\n",
       "      <td>17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Portugal</td>\n",
       "      <td>6</td>\n",
       "      <td>22</td>\n",
       "      <td>42</td>\n",
       "      <td>34.3%</td>\n",
       "      <td>9.3%</td>\n",
       "      <td>82</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>10</td>\n",
       "      <td>71.5%</td>\n",
       "      <td>73</td>\n",
       "      <td>90</td>\n",
       "      <td>10</td>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "      <td>14</td>\n",
       "      <td>14</td>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Republic of Ireland</td>\n",
       "      <td>1</td>\n",
       "      <td>7</td>\n",
       "      <td>12</td>\n",
       "      <td>36.8%</td>\n",
       "      <td>5.2%</td>\n",
       "      <td>28</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>17</td>\n",
       "      <td>65.4%</td>\n",
       "      <td>43</td>\n",
       "      <td>51</td>\n",
       "      <td>11</td>\n",
       "      <td>6</td>\n",
       "      <td>1</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Russia</td>\n",
       "      <td>5</td>\n",
       "      <td>9</td>\n",
       "      <td>31</td>\n",
       "      <td>22.5%</td>\n",
       "      <td>12.5%</td>\n",
       "      <td>59</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>10</td>\n",
       "      <td>77.0%</td>\n",
       "      <td>34</td>\n",
       "      <td>43</td>\n",
       "      <td>4</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>7</td>\n",
       "      <td>7</td>\n",
       "      <td>16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Spain</td>\n",
       "      <td>12</td>\n",
       "      <td>42</td>\n",
       "      <td>33</td>\n",
       "      <td>55.9%</td>\n",
       "      <td>16.0%</td>\n",
       "      <td>100</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>15</td>\n",
       "      <td>93.8%</td>\n",
       "      <td>102</td>\n",
       "      <td>83</td>\n",
       "      <td>19</td>\n",
       "      <td>11</td>\n",
       "      <td>0</td>\n",
       "      <td>17</td>\n",
       "      <td>17</td>\n",
       "      <td>18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>Sweden</td>\n",
       "      <td>5</td>\n",
       "      <td>17</td>\n",
       "      <td>19</td>\n",
       "      <td>47.2%</td>\n",
       "      <td>13.8%</td>\n",
       "      <td>39</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>8</td>\n",
       "      <td>61.6%</td>\n",
       "      <td>35</td>\n",
       "      <td>51</td>\n",
       "      <td>7</td>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>9</td>\n",
       "      <td>18</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>Ukraine</td>\n",
       "      <td>2</td>\n",
       "      <td>7</td>\n",
       "      <td>26</td>\n",
       "      <td>21.2%</td>\n",
       "      <td>6.0%</td>\n",
       "      <td>38</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>13</td>\n",
       "      <td>76.5%</td>\n",
       "      <td>48</td>\n",
       "      <td>31</td>\n",
       "      <td>4</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>9</td>\n",
       "      <td>18</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>16 rows × 35 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                   Team  Goals  Shots on target  Shots off target  \\\n",
       "0               Croatia      4               13                12   \n",
       "1        Czech Republic      4               13                18   \n",
       "2               Denmark      4               10                10   \n",
       "3               England      5               11                18   \n",
       "4                France      3               22                24   \n",
       "5               Germany     10               32                32   \n",
       "6                Greece      5                8                18   \n",
       "7                 Italy      6               34                45   \n",
       "8           Netherlands      2               12                36   \n",
       "9                Poland      2               15                23   \n",
       "10             Portugal      6               22                42   \n",
       "11  Republic of Ireland      1                7                12   \n",
       "12               Russia      5                9                31   \n",
       "13                Spain     12               42                33   \n",
       "14               Sweden      5               17                19   \n",
       "15              Ukraine      2                7                26   \n",
       "\n",
       "   Shooting Accuracy % Goals-to-shots  Total shots (inc. Blocked)  \\\n",
       "0              51.9%            16.0%                          32   \n",
       "1              41.9%            12.9%                          39   \n",
       "2              50.0%            20.0%                          27   \n",
       "3              50.0%            17.2%                          40   \n",
       "4              37.9%             6.5%                          65   \n",
       "5              47.8%            15.6%                          80   \n",
       "6              30.7%            19.2%                          32   \n",
       "7              43.0%             7.5%                         110   \n",
       "8              25.0%             4.1%                          60   \n",
       "9              39.4%             5.2%                          48   \n",
       "10             34.3%             9.3%                          82   \n",
       "11             36.8%             5.2%                          28   \n",
       "12             22.5%            12.5%                          59   \n",
       "13             55.9%            16.0%                         100   \n",
       "14             47.2%            13.8%                          39   \n",
       "15             21.2%             6.0%                          38   \n",
       "\n",
       "    Hit Woodwork  Penalty goals  Penalties not scored      ...       \\\n",
       "0              0              0                     0      ...        \n",
       "1              0              0                     0      ...        \n",
       "2              1              0                     0      ...        \n",
       "3              0              0                     0      ...        \n",
       "4              1              0                     0      ...        \n",
       "5              2              1                     0      ...        \n",
       "6              1              1                     1      ...        \n",
       "7              2              0                     0      ...        \n",
       "8              2              0                     0      ...        \n",
       "9              0              0                     0      ...        \n",
       "10             6              0                     0      ...        \n",
       "11             0              0                     0      ...        \n",
       "12             2              0                     0      ...        \n",
       "13             0              1                     0      ...        \n",
       "14             3              0                     0      ...        \n",
       "15             0              0                     0      ...        \n",
       "\n",
       "    Saves made  Saves-to-shots ratio  Fouls Won Fouls Conceded  Offsides  \\\n",
       "0           13                 81.3%         41             62         2   \n",
       "1            9                 60.1%         53             73         8   \n",
       "2           10                 66.7%         25             38         8   \n",
       "3           22                 88.1%         43             45         6   \n",
       "4            6                 54.6%         36             51         5   \n",
       "5           10                 62.6%         63             49        12   \n",
       "6           13                 65.1%         67             48        12   \n",
       "7           20                 74.1%        101             89        16   \n",
       "8           12                 70.6%         35             30         3   \n",
       "9            6                 66.7%         48             56         3   \n",
       "10          10                 71.5%         73             90        10   \n",
       "11          17                 65.4%         43             51        11   \n",
       "12          10                 77.0%         34             43         4   \n",
       "13          15                 93.8%        102             83        19   \n",
       "14           8                 61.6%         35             51         7   \n",
       "15          13                 76.5%         48             31         4   \n",
       "\n",
       "    Yellow Cards  Red Cards  Subs on  Subs off  Players Used  \n",
       "0              9          0        9         9            16  \n",
       "1              7          0       11        11            19  \n",
       "2              4          0        7         7            15  \n",
       "3              5          0       11        11            16  \n",
       "4              6          0       11        11            19  \n",
       "5              4          0       15        15            17  \n",
       "6              9          1       12        12            20  \n",
       "7             16          0       18        18            19  \n",
       "8              5          0        7         7            15  \n",
       "9              7          1        7         7            17  \n",
       "10            12          0       14        14            16  \n",
       "11             6          1       10        10            17  \n",
       "12             6          0        7         7            16  \n",
       "13            11          0       17        17            18  \n",
       "14             7          0        9         9            18  \n",
       "15             5          0        9         9            18  \n",
       "\n",
       "[16 rows x 35 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "euro12 = pd.read_csv(path2)\n",
    "euro12"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 问题1：只选取 ```Goals``` 这一列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0      4\n",
       "1      4\n",
       "2      4\n",
       "3      5\n",
       "4      3\n",
       "5     10\n",
       "6      5\n",
       "7      6\n",
       "8      2\n",
       "9      2\n",
       "10     6\n",
       "11     1\n",
       "12     5\n",
       "13    12\n",
       "14     5\n",
       "15     2\n",
       "Name: Goals, dtype: int64"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "euro12.Goals"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 问题2：有多少球队参与了2012欧洲杯？"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "16"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "euro12.shape[0]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 问题3：该数据集中一共有多少列(columns)?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 16 entries, 0 to 15\n",
      "Data columns (total 35 columns):\n",
      "Team                          16 non-null object\n",
      "Goals                         16 non-null int64\n",
      "Shots on target               16 non-null int64\n",
      "Shots off target              16 non-null int64\n",
      "Shooting Accuracy             16 non-null object\n",
      "% Goals-to-shots              16 non-null object\n",
      "Total shots (inc. Blocked)    16 non-null int64\n",
      "Hit Woodwork                  16 non-null int64\n",
      "Penalty goals                 16 non-null int64\n",
      "Penalties not scored          16 non-null int64\n",
      "Headed goals                  16 non-null int64\n",
      "Passes                        16 non-null int64\n",
      "Passes completed              16 non-null int64\n",
      "Passing Accuracy              16 non-null object\n",
      "Touches                       16 non-null int64\n",
      "Crosses                       16 non-null int64\n",
      "Dribbles                      16 non-null int64\n",
      "Corners Taken                 16 non-null int64\n",
      "Tackles                       16 non-null int64\n",
      "Clearances                    16 non-null int64\n",
      "Interceptions                 16 non-null int64\n",
      "Clearances off line           15 non-null float64\n",
      "Clean Sheets                  16 non-null int64\n",
      "Blocks                        16 non-null int64\n",
      "Goals conceded                16 non-null int64\n",
      "Saves made                    16 non-null int64\n",
      "Saves-to-shots ratio          16 non-null object\n",
      "Fouls Won                     16 non-null int64\n",
      "Fouls Conceded                16 non-null int64\n",
      "Offsides                      16 non-null int64\n",
      "Yellow Cards                  16 non-null int64\n",
      "Red Cards                     16 non-null int64\n",
      "Subs on                       16 non-null int64\n",
      "Subs off                      16 non-null int64\n",
      "Players Used                  16 non-null int64\n",
      "dtypes: float64(1), int64(29), object(5)\n",
      "memory usage: 4.1+ KB\n"
     ]
    }
   ],
   "source": [
    "euro12.info()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 问题4：将数据集中的列Team, Yellow Cards和Red Cards单独存为一个名叫discipline的数据框"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Team</th>\n",
       "      <th>Yellow Cards</th>\n",
       "      <th>Red Cards</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Croatia</td>\n",
       "      <td>9</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Czech Republic</td>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Denmark</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>England</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>France</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Germany</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Greece</td>\n",
       "      <td>9</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Italy</td>\n",
       "      <td>16</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Netherlands</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Poland</td>\n",
       "      <td>7</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Portugal</td>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Republic of Ireland</td>\n",
       "      <td>6</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Russia</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Spain</td>\n",
       "      <td>11</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>Sweden</td>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>Ukraine</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   Team  Yellow Cards  Red Cards\n",
       "0               Croatia             9          0\n",
       "1        Czech Republic             7          0\n",
       "2               Denmark             4          0\n",
       "3               England             5          0\n",
       "4                France             6          0\n",
       "5               Germany             4          0\n",
       "6                Greece             9          1\n",
       "7                 Italy            16          0\n",
       "8           Netherlands             5          0\n",
       "9                Poland             7          1\n",
       "10             Portugal            12          0\n",
       "11  Republic of Ireland             6          1\n",
       "12               Russia             6          0\n",
       "13                Spain            11          0\n",
       "14               Sweden             7          0\n",
       "15              Ukraine             5          0"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "discipline = euro12[['Team', 'Yellow Cards', 'Red Cards']]\n",
    "discipline"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 问题5：对数据框discipline按照先Red Cards再Yellow Cards进行排序"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Team</th>\n",
       "      <th>Yellow Cards</th>\n",
       "      <th>Red Cards</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Greece</td>\n",
       "      <td>9</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Poland</td>\n",
       "      <td>7</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Republic of Ireland</td>\n",
       "      <td>6</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Italy</td>\n",
       "      <td>16</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Portugal</td>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Spain</td>\n",
       "      <td>11</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Croatia</td>\n",
       "      <td>9</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Czech Republic</td>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>Sweden</td>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>France</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Russia</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>England</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Netherlands</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>Ukraine</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Denmark</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Germany</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   Team  Yellow Cards  Red Cards\n",
       "6                Greece             9          1\n",
       "9                Poland             7          1\n",
       "11  Republic of Ireland             6          1\n",
       "7                 Italy            16          0\n",
       "10             Portugal            12          0\n",
       "13                Spain            11          0\n",
       "0               Croatia             9          0\n",
       "1        Czech Republic             7          0\n",
       "14               Sweden             7          0\n",
       "4                France             6          0\n",
       "12               Russia             6          0\n",
       "3               England             5          0\n",
       "8           Netherlands             5          0\n",
       "15              Ukraine             5          0\n",
       "2               Denmark             4          0\n",
       "5               Germany             4          0"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "discipline.sort_values(['Red Cards', 'Yellow Cards'], ascending = False)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 问题6：计算球队拿到的黄牌数的平均值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "7.4375"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "discipline['Yellow Cards'].mean()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 问题7：找到进球数Goals超过6的球队数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Team</th>\n",
       "      <th>Goals</th>\n",
       "      <th>Shots on target</th>\n",
       "      <th>Shots off target</th>\n",
       "      <th>Shooting Accuracy</th>\n",
       "      <th>% Goals-to-shots</th>\n",
       "      <th>Total shots (inc. Blocked)</th>\n",
       "      <th>Hit Woodwork</th>\n",
       "      <th>Penalty goals</th>\n",
       "      <th>Penalties not scored</th>\n",
       "      <th>...</th>\n",
       "      <th>Saves made</th>\n",
       "      <th>Saves-to-shots ratio</th>\n",
       "      <th>Fouls Won</th>\n",
       "      <th>Fouls Conceded</th>\n",
       "      <th>Offsides</th>\n",
       "      <th>Yellow Cards</th>\n",
       "      <th>Red Cards</th>\n",
       "      <th>Subs on</th>\n",
       "      <th>Subs off</th>\n",
       "      <th>Players Used</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Germany</td>\n",
       "      <td>10</td>\n",
       "      <td>32</td>\n",
       "      <td>32</td>\n",
       "      <td>47.8%</td>\n",
       "      <td>15.6%</td>\n",
       "      <td>80</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>10</td>\n",
       "      <td>62.6%</td>\n",
       "      <td>63</td>\n",
       "      <td>49</td>\n",
       "      <td>12</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>15</td>\n",
       "      <td>15</td>\n",
       "      <td>17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Spain</td>\n",
       "      <td>12</td>\n",
       "      <td>42</td>\n",
       "      <td>33</td>\n",
       "      <td>55.9%</td>\n",
       "      <td>16.0%</td>\n",
       "      <td>100</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>15</td>\n",
       "      <td>93.8%</td>\n",
       "      <td>102</td>\n",
       "      <td>83</td>\n",
       "      <td>19</td>\n",
       "      <td>11</td>\n",
       "      <td>0</td>\n",
       "      <td>17</td>\n",
       "      <td>17</td>\n",
       "      <td>18</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>2 rows × 35 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "       Team  Goals  Shots on target  Shots off target Shooting Accuracy  \\\n",
       "5   Germany     10               32                32             47.8%   \n",
       "13    Spain     12               42                33             55.9%   \n",
       "\n",
       "   % Goals-to-shots  Total shots (inc. Blocked)  Hit Woodwork  Penalty goals  \\\n",
       "5             15.6%                          80             2              1   \n",
       "13            16.0%                         100             0              1   \n",
       "\n",
       "    Penalties not scored      ...       Saves made  Saves-to-shots ratio  \\\n",
       "5                      0      ...               10                 62.6%   \n",
       "13                     0      ...               15                 93.8%   \n",
       "\n",
       "    Fouls Won Fouls Conceded  Offsides  Yellow Cards  Red Cards  Subs on  \\\n",
       "5          63             49        12             4          0       15   \n",
       "13        102             83        19            11          0       17   \n",
       "\n",
       "    Subs off  Players Used  \n",
       "5         15            17  \n",
       "13        17            18  \n",
       "\n",
       "[2 rows x 35 columns]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "euro12[euro12.Goals > 6]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 问题8：选取以字母G开头的球队数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Team</th>\n",
       "      <th>Goals</th>\n",
       "      <th>Shots on target</th>\n",
       "      <th>Shots off target</th>\n",
       "      <th>Shooting Accuracy</th>\n",
       "      <th>% Goals-to-shots</th>\n",
       "      <th>Total shots (inc. Blocked)</th>\n",
       "      <th>Hit Woodwork</th>\n",
       "      <th>Penalty goals</th>\n",
       "      <th>Penalties not scored</th>\n",
       "      <th>...</th>\n",
       "      <th>Saves made</th>\n",
       "      <th>Saves-to-shots ratio</th>\n",
       "      <th>Fouls Won</th>\n",
       "      <th>Fouls Conceded</th>\n",
       "      <th>Offsides</th>\n",
       "      <th>Yellow Cards</th>\n",
       "      <th>Red Cards</th>\n",
       "      <th>Subs on</th>\n",
       "      <th>Subs off</th>\n",
       "      <th>Players Used</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Germany</td>\n",
       "      <td>10</td>\n",
       "      <td>32</td>\n",
       "      <td>32</td>\n",
       "      <td>47.8%</td>\n",
       "      <td>15.6%</td>\n",
       "      <td>80</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>10</td>\n",
       "      <td>62.6%</td>\n",
       "      <td>63</td>\n",
       "      <td>49</td>\n",
       "      <td>12</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "      <td>15</td>\n",
       "      <td>15</td>\n",
       "      <td>17</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Greece</td>\n",
       "      <td>5</td>\n",
       "      <td>8</td>\n",
       "      <td>18</td>\n",
       "      <td>30.7%</td>\n",
       "      <td>19.2%</td>\n",
       "      <td>32</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>13</td>\n",
       "      <td>65.1%</td>\n",
       "      <td>67</td>\n",
       "      <td>48</td>\n",
       "      <td>12</td>\n",
       "      <td>9</td>\n",
       "      <td>1</td>\n",
       "      <td>12</td>\n",
       "      <td>12</td>\n",
       "      <td>20</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>2 rows × 35 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      Team  Goals  Shots on target  Shots off target Shooting Accuracy  \\\n",
       "5  Germany     10               32                32             47.8%   \n",
       "6   Greece      5                8                18             30.7%   \n",
       "\n",
       "  % Goals-to-shots  Total shots (inc. Blocked)  Hit Woodwork  Penalty goals  \\\n",
       "5            15.6%                          80             2              1   \n",
       "6            19.2%                          32             1              1   \n",
       "\n",
       "   Penalties not scored      ...       Saves made  Saves-to-shots ratio  \\\n",
       "5                     0      ...               10                 62.6%   \n",
       "6                     1      ...               13                 65.1%   \n",
       "\n",
       "   Fouls Won Fouls Conceded  Offsides  Yellow Cards  Red Cards  Subs on  \\\n",
       "5         63             49        12             4          0       15   \n",
       "6         67             48        12             9          1       12   \n",
       "\n",
       "   Subs off  Players Used  \n",
       "5        15            17  \n",
       "6        12            20  \n",
       "\n",
       "[2 rows x 35 columns]"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "euro12[euro12.Team.str.startswith('G')]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 问题9：选取前7列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Team</th>\n",
       "      <th>Goals</th>\n",
       "      <th>Shots on target</th>\n",
       "      <th>Shots off target</th>\n",
       "      <th>Shooting Accuracy</th>\n",
       "      <th>% Goals-to-shots</th>\n",
       "      <th>Total shots (inc. Blocked)</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Croatia</td>\n",
       "      <td>4</td>\n",
       "      <td>13</td>\n",
       "      <td>12</td>\n",
       "      <td>51.9%</td>\n",
       "      <td>16.0%</td>\n",
       "      <td>32</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Czech Republic</td>\n",
       "      <td>4</td>\n",
       "      <td>13</td>\n",
       "      <td>18</td>\n",
       "      <td>41.9%</td>\n",
       "      <td>12.9%</td>\n",
       "      <td>39</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Denmark</td>\n",
       "      <td>4</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>50.0%</td>\n",
       "      <td>20.0%</td>\n",
       "      <td>27</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>England</td>\n",
       "      <td>5</td>\n",
       "      <td>11</td>\n",
       "      <td>18</td>\n",
       "      <td>50.0%</td>\n",
       "      <td>17.2%</td>\n",
       "      <td>40</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>France</td>\n",
       "      <td>3</td>\n",
       "      <td>22</td>\n",
       "      <td>24</td>\n",
       "      <td>37.9%</td>\n",
       "      <td>6.5%</td>\n",
       "      <td>65</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Germany</td>\n",
       "      <td>10</td>\n",
       "      <td>32</td>\n",
       "      <td>32</td>\n",
       "      <td>47.8%</td>\n",
       "      <td>15.6%</td>\n",
       "      <td>80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Greece</td>\n",
       "      <td>5</td>\n",
       "      <td>8</td>\n",
       "      <td>18</td>\n",
       "      <td>30.7%</td>\n",
       "      <td>19.2%</td>\n",
       "      <td>32</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Italy</td>\n",
       "      <td>6</td>\n",
       "      <td>34</td>\n",
       "      <td>45</td>\n",
       "      <td>43.0%</td>\n",
       "      <td>7.5%</td>\n",
       "      <td>110</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Netherlands</td>\n",
       "      <td>2</td>\n",
       "      <td>12</td>\n",
       "      <td>36</td>\n",
       "      <td>25.0%</td>\n",
       "      <td>4.1%</td>\n",
       "      <td>60</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Poland</td>\n",
       "      <td>2</td>\n",
       "      <td>15</td>\n",
       "      <td>23</td>\n",
       "      <td>39.4%</td>\n",
       "      <td>5.2%</td>\n",
       "      <td>48</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Portugal</td>\n",
       "      <td>6</td>\n",
       "      <td>22</td>\n",
       "      <td>42</td>\n",
       "      <td>34.3%</td>\n",
       "      <td>9.3%</td>\n",
       "      <td>82</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Republic of Ireland</td>\n",
       "      <td>1</td>\n",
       "      <td>7</td>\n",
       "      <td>12</td>\n",
       "      <td>36.8%</td>\n",
       "      <td>5.2%</td>\n",
       "      <td>28</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Russia</td>\n",
       "      <td>5</td>\n",
       "      <td>9</td>\n",
       "      <td>31</td>\n",
       "      <td>22.5%</td>\n",
       "      <td>12.5%</td>\n",
       "      <td>59</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Spain</td>\n",
       "      <td>12</td>\n",
       "      <td>42</td>\n",
       "      <td>33</td>\n",
       "      <td>55.9%</td>\n",
       "      <td>16.0%</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>Sweden</td>\n",
       "      <td>5</td>\n",
       "      <td>17</td>\n",
       "      <td>19</td>\n",
       "      <td>47.2%</td>\n",
       "      <td>13.8%</td>\n",
       "      <td>39</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>Ukraine</td>\n",
       "      <td>2</td>\n",
       "      <td>7</td>\n",
       "      <td>26</td>\n",
       "      <td>21.2%</td>\n",
       "      <td>6.0%</td>\n",
       "      <td>38</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   Team  Goals  Shots on target  Shots off target  \\\n",
       "0               Croatia      4               13                12   \n",
       "1        Czech Republic      4               13                18   \n",
       "2               Denmark      4               10                10   \n",
       "3               England      5               11                18   \n",
       "4                France      3               22                24   \n",
       "5               Germany     10               32                32   \n",
       "6                Greece      5                8                18   \n",
       "7                 Italy      6               34                45   \n",
       "8           Netherlands      2               12                36   \n",
       "9                Poland      2               15                23   \n",
       "10             Portugal      6               22                42   \n",
       "11  Republic of Ireland      1                7                12   \n",
       "12               Russia      5                9                31   \n",
       "13                Spain     12               42                33   \n",
       "14               Sweden      5               17                19   \n",
       "15              Ukraine      2                7                26   \n",
       "\n",
       "   Shooting Accuracy % Goals-to-shots  Total shots (inc. Blocked)  \n",
       "0              51.9%            16.0%                          32  \n",
       "1              41.9%            12.9%                          39  \n",
       "2              50.0%            20.0%                          27  \n",
       "3              50.0%            17.2%                          40  \n",
       "4              37.9%             6.5%                          65  \n",
       "5              47.8%            15.6%                          80  \n",
       "6              30.7%            19.2%                          32  \n",
       "7              43.0%             7.5%                         110  \n",
       "8              25.0%             4.1%                          60  \n",
       "9              39.4%             5.2%                          48  \n",
       "10             34.3%             9.3%                          82  \n",
       "11             36.8%             5.2%                          28  \n",
       "12             22.5%            12.5%                          59  \n",
       "13             55.9%            16.0%                         100  \n",
       "14             47.2%            13.8%                          39  \n",
       "15             21.2%             6.0%                          38  "
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "euro12.iloc[: , 0:7]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 问题10：选取除了最后3列之外的全部列"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Team</th>\n",
       "      <th>Goals</th>\n",
       "      <th>Shots on target</th>\n",
       "      <th>Shots off target</th>\n",
       "      <th>Shooting Accuracy</th>\n",
       "      <th>% Goals-to-shots</th>\n",
       "      <th>Total shots (inc. Blocked)</th>\n",
       "      <th>Hit Woodwork</th>\n",
       "      <th>Penalty goals</th>\n",
       "      <th>Penalties not scored</th>\n",
       "      <th>...</th>\n",
       "      <th>Clean Sheets</th>\n",
       "      <th>Blocks</th>\n",
       "      <th>Goals conceded</th>\n",
       "      <th>Saves made</th>\n",
       "      <th>Saves-to-shots ratio</th>\n",
       "      <th>Fouls Won</th>\n",
       "      <th>Fouls Conceded</th>\n",
       "      <th>Offsides</th>\n",
       "      <th>Yellow Cards</th>\n",
       "      <th>Red Cards</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Croatia</td>\n",
       "      <td>4</td>\n",
       "      <td>13</td>\n",
       "      <td>12</td>\n",
       "      <td>51.9%</td>\n",
       "      <td>16.0%</td>\n",
       "      <td>32</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>10</td>\n",
       "      <td>3</td>\n",
       "      <td>13</td>\n",
       "      <td>81.3%</td>\n",
       "      <td>41</td>\n",
       "      <td>62</td>\n",
       "      <td>2</td>\n",
       "      <td>9</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Czech Republic</td>\n",
       "      <td>4</td>\n",
       "      <td>13</td>\n",
       "      <td>18</td>\n",
       "      <td>41.9%</td>\n",
       "      <td>12.9%</td>\n",
       "      <td>39</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>10</td>\n",
       "      <td>6</td>\n",
       "      <td>9</td>\n",
       "      <td>60.1%</td>\n",
       "      <td>53</td>\n",
       "      <td>73</td>\n",
       "      <td>8</td>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Denmark</td>\n",
       "      <td>4</td>\n",
       "      <td>10</td>\n",
       "      <td>10</td>\n",
       "      <td>50.0%</td>\n",
       "      <td>20.0%</td>\n",
       "      <td>27</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>10</td>\n",
       "      <td>5</td>\n",
       "      <td>10</td>\n",
       "      <td>66.7%</td>\n",
       "      <td>25</td>\n",
       "      <td>38</td>\n",
       "      <td>8</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>England</td>\n",
       "      <td>5</td>\n",
       "      <td>11</td>\n",
       "      <td>18</td>\n",
       "      <td>50.0%</td>\n",
       "      <td>17.2%</td>\n",
       "      <td>40</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>2</td>\n",
       "      <td>29</td>\n",
       "      <td>3</td>\n",
       "      <td>22</td>\n",
       "      <td>88.1%</td>\n",
       "      <td>43</td>\n",
       "      <td>45</td>\n",
       "      <td>6</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>France</td>\n",
       "      <td>3</td>\n",
       "      <td>22</td>\n",
       "      <td>24</td>\n",
       "      <td>37.9%</td>\n",
       "      <td>6.5%</td>\n",
       "      <td>65</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>7</td>\n",
       "      <td>5</td>\n",
       "      <td>6</td>\n",
       "      <td>54.6%</td>\n",
       "      <td>36</td>\n",
       "      <td>51</td>\n",
       "      <td>5</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Germany</td>\n",
       "      <td>10</td>\n",
       "      <td>32</td>\n",
       "      <td>32</td>\n",
       "      <td>47.8%</td>\n",
       "      <td>15.6%</td>\n",
       "      <td>80</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>11</td>\n",
       "      <td>6</td>\n",
       "      <td>10</td>\n",
       "      <td>62.6%</td>\n",
       "      <td>63</td>\n",
       "      <td>49</td>\n",
       "      <td>12</td>\n",
       "      <td>4</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>Greece</td>\n",
       "      <td>5</td>\n",
       "      <td>8</td>\n",
       "      <td>18</td>\n",
       "      <td>30.7%</td>\n",
       "      <td>19.2%</td>\n",
       "      <td>32</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>23</td>\n",
       "      <td>7</td>\n",
       "      <td>13</td>\n",
       "      <td>65.1%</td>\n",
       "      <td>67</td>\n",
       "      <td>48</td>\n",
       "      <td>12</td>\n",
       "      <td>9</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Italy</td>\n",
       "      <td>6</td>\n",
       "      <td>34</td>\n",
       "      <td>45</td>\n",
       "      <td>43.0%</td>\n",
       "      <td>7.5%</td>\n",
       "      <td>110</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>2</td>\n",
       "      <td>18</td>\n",
       "      <td>7</td>\n",
       "      <td>20</td>\n",
       "      <td>74.1%</td>\n",
       "      <td>101</td>\n",
       "      <td>89</td>\n",
       "      <td>16</td>\n",
       "      <td>16</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>Netherlands</td>\n",
       "      <td>2</td>\n",
       "      <td>12</td>\n",
       "      <td>36</td>\n",
       "      <td>25.0%</td>\n",
       "      <td>4.1%</td>\n",
       "      <td>60</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>9</td>\n",
       "      <td>5</td>\n",
       "      <td>12</td>\n",
       "      <td>70.6%</td>\n",
       "      <td>35</td>\n",
       "      <td>30</td>\n",
       "      <td>3</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>Poland</td>\n",
       "      <td>2</td>\n",
       "      <td>15</td>\n",
       "      <td>23</td>\n",
       "      <td>39.4%</td>\n",
       "      <td>5.2%</td>\n",
       "      <td>48</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>8</td>\n",
       "      <td>3</td>\n",
       "      <td>6</td>\n",
       "      <td>66.7%</td>\n",
       "      <td>48</td>\n",
       "      <td>56</td>\n",
       "      <td>3</td>\n",
       "      <td>7</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>Portugal</td>\n",
       "      <td>6</td>\n",
       "      <td>22</td>\n",
       "      <td>42</td>\n",
       "      <td>34.3%</td>\n",
       "      <td>9.3%</td>\n",
       "      <td>82</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>2</td>\n",
       "      <td>11</td>\n",
       "      <td>4</td>\n",
       "      <td>10</td>\n",
       "      <td>71.5%</td>\n",
       "      <td>73</td>\n",
       "      <td>90</td>\n",
       "      <td>10</td>\n",
       "      <td>12</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>Republic of Ireland</td>\n",
       "      <td>1</td>\n",
       "      <td>7</td>\n",
       "      <td>12</td>\n",
       "      <td>36.8%</td>\n",
       "      <td>5.2%</td>\n",
       "      <td>28</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>23</td>\n",
       "      <td>9</td>\n",
       "      <td>17</td>\n",
       "      <td>65.4%</td>\n",
       "      <td>43</td>\n",
       "      <td>51</td>\n",
       "      <td>11</td>\n",
       "      <td>6</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Russia</td>\n",
       "      <td>5</td>\n",
       "      <td>9</td>\n",
       "      <td>31</td>\n",
       "      <td>22.5%</td>\n",
       "      <td>12.5%</td>\n",
       "      <td>59</td>\n",
       "      <td>2</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>8</td>\n",
       "      <td>3</td>\n",
       "      <td>10</td>\n",
       "      <td>77.0%</td>\n",
       "      <td>34</td>\n",
       "      <td>43</td>\n",
       "      <td>4</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>Spain</td>\n",
       "      <td>12</td>\n",
       "      <td>42</td>\n",
       "      <td>33</td>\n",
       "      <td>55.9%</td>\n",
       "      <td>16.0%</td>\n",
       "      <td>100</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>5</td>\n",
       "      <td>8</td>\n",
       "      <td>1</td>\n",
       "      <td>15</td>\n",
       "      <td>93.8%</td>\n",
       "      <td>102</td>\n",
       "      <td>83</td>\n",
       "      <td>19</td>\n",
       "      <td>11</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>Sweden</td>\n",
       "      <td>5</td>\n",
       "      <td>17</td>\n",
       "      <td>19</td>\n",
       "      <td>47.2%</td>\n",
       "      <td>13.8%</td>\n",
       "      <td>39</td>\n",
       "      <td>3</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>12</td>\n",
       "      <td>5</td>\n",
       "      <td>8</td>\n",
       "      <td>61.6%</td>\n",
       "      <td>35</td>\n",
       "      <td>51</td>\n",
       "      <td>7</td>\n",
       "      <td>7</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>Ukraine</td>\n",
       "      <td>2</td>\n",
       "      <td>7</td>\n",
       "      <td>26</td>\n",
       "      <td>21.2%</td>\n",
       "      <td>6.0%</td>\n",
       "      <td>38</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>4</td>\n",
       "      <td>4</td>\n",
       "      <td>13</td>\n",
       "      <td>76.5%</td>\n",
       "      <td>48</td>\n",
       "      <td>31</td>\n",
       "      <td>4</td>\n",
       "      <td>5</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>16 rows × 32 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                   Team  Goals  Shots on target  Shots off target  \\\n",
       "0               Croatia      4               13                12   \n",
       "1        Czech Republic      4               13                18   \n",
       "2               Denmark      4               10                10   \n",
       "3               England      5               11                18   \n",
       "4                France      3               22                24   \n",
       "5               Germany     10               32                32   \n",
       "6                Greece      5                8                18   \n",
       "7                 Italy      6               34                45   \n",
       "8           Netherlands      2               12                36   \n",
       "9                Poland      2               15                23   \n",
       "10             Portugal      6               22                42   \n",
       "11  Republic of Ireland      1                7                12   \n",
       "12               Russia      5                9                31   \n",
       "13                Spain     12               42                33   \n",
       "14               Sweden      5               17                19   \n",
       "15              Ukraine      2                7                26   \n",
       "\n",
       "   Shooting Accuracy % Goals-to-shots  Total shots (inc. Blocked)  \\\n",
       "0              51.9%            16.0%                          32   \n",
       "1              41.9%            12.9%                          39   \n",
       "2              50.0%            20.0%                          27   \n",
       "3              50.0%            17.2%                          40   \n",
       "4              37.9%             6.5%                          65   \n",
       "5              47.8%            15.6%                          80   \n",
       "6              30.7%            19.2%                          32   \n",
       "7              43.0%             7.5%                         110   \n",
       "8              25.0%             4.1%                          60   \n",
       "9              39.4%             5.2%                          48   \n",
       "10             34.3%             9.3%                          82   \n",
       "11             36.8%             5.2%                          28   \n",
       "12             22.5%            12.5%                          59   \n",
       "13             55.9%            16.0%                         100   \n",
       "14             47.2%            13.8%                          39   \n",
       "15             21.2%             6.0%                          38   \n",
       "\n",
       "    Hit Woodwork  Penalty goals  Penalties not scored    ...      \\\n",
       "0              0              0                     0    ...       \n",
       "1              0              0                     0    ...       \n",
       "2              1              0                     0    ...       \n",
       "3              0              0                     0    ...       \n",
       "4              1              0                     0    ...       \n",
       "5              2              1                     0    ...       \n",
       "6              1              1                     1    ...       \n",
       "7              2              0                     0    ...       \n",
       "8              2              0                     0    ...       \n",
       "9              0              0                     0    ...       \n",
       "10             6              0                     0    ...       \n",
       "11             0              0                     0    ...       \n",
       "12             2              0                     0    ...       \n",
       "13             0              1                     0    ...       \n",
       "14             3              0                     0    ...       \n",
       "15             0              0                     0    ...       \n",
       "\n",
       "    Clean Sheets  Blocks  Goals conceded Saves made  Saves-to-shots ratio  \\\n",
       "0              0      10               3         13                 81.3%   \n",
       "1              1      10               6          9                 60.1%   \n",
       "2              1      10               5         10                 66.7%   \n",
       "3              2      29               3         22                 88.1%   \n",
       "4              1       7               5          6                 54.6%   \n",
       "5              1      11               6         10                 62.6%   \n",
       "6              1      23               7         13                 65.1%   \n",
       "7              2      18               7         20                 74.1%   \n",
       "8              0       9               5         12                 70.6%   \n",
       "9              0       8               3          6                 66.7%   \n",
       "10             2      11               4         10                 71.5%   \n",
       "11             0      23               9         17                 65.4%   \n",
       "12             0       8               3         10                 77.0%   \n",
       "13             5       8               1         15                 93.8%   \n",
       "14             1      12               5          8                 61.6%   \n",
       "15             0       4               4         13                 76.5%   \n",
       "\n",
       "    Fouls Won  Fouls Conceded  Offsides  Yellow Cards  Red Cards  \n",
       "0          41              62         2             9          0  \n",
       "1          53              73         8             7          0  \n",
       "2          25              38         8             4          0  \n",
       "3          43              45         6             5          0  \n",
       "4          36              51         5             6          0  \n",
       "5          63              49        12             4          0  \n",
       "6          67              48        12             9          1  \n",
       "7         101              89        16            16          0  \n",
       "8          35              30         3             5          0  \n",
       "9          48              56         3             7          1  \n",
       "10         73              90        10            12          0  \n",
       "11         43              51        11             6          1  \n",
       "12         34              43         4             6          0  \n",
       "13        102              83        19            11          0  \n",
       "14         35              51         7             7          0  \n",
       "15         48              31         4             5          0  \n",
       "\n",
       "[16 rows x 32 columns]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "euro12.iloc[: , :-3]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 问题11：找到英格兰(England)、意大利(Italy)和俄罗斯(Russia)的射正率(Shooting Accuracy)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Team</th>\n",
       "      <th>Shooting Accuracy</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>England</td>\n",
       "      <td>50.0%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>Italy</td>\n",
       "      <td>43.0%</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>Russia</td>\n",
       "      <td>22.5%</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       Team Shooting Accuracy\n",
       "3   England             50.0%\n",
       "7     Italy             43.0%\n",
       "12   Russia             22.5%"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "euro12.loc[euro12.Team.isin(['England', 'Italy', 'Russia']), ['Team','Shooting Accuracy']]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 射门数最多的球队是哪个？"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Team                          Italy\n",
       "Goals                             6\n",
       "Shots on target                  34\n",
       "Shots off target                 45\n",
       "Shooting Accuracy             43.0%\n",
       "% Goals-to-shots               7.5%\n",
       "Total shots (inc. Blocked)      110\n",
       "Hit Woodwork                      2\n",
       "Penalty goals                     0\n",
       "Penalties not scored              0\n",
       "Headed goals                      2\n",
       "Passes                         3016\n",
       "Passes completed               2531\n",
       "Passing Accuracy              83.9%\n",
       "Touches                        4363\n",
       "Crosses                          75\n",
       "Dribbles                         75\n",
       "Corners Taken                    30\n",
       "Tackles                          98\n",
       "Clearances                      137\n",
       "Interceptions                   136\n",
       "Clearances off line               1\n",
       "Clean Sheets                      2\n",
       "Blocks                           18\n",
       "Goals conceded                    7\n",
       "Saves made                       20\n",
       "Saves-to-shots ratio          74.1%\n",
       "Fouls Won                       101\n",
       "Fouls Conceded                   89\n",
       "Offsides                         16\n",
       "Yellow Cards                     16\n",
       "Red Cards                         0\n",
       "Subs on                          18\n",
       "Subs off                         18\n",
       "Players Used                     19\n",
       "Name: 7, dtype: object"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "euro12.iloc[euro12['Total shots (inc. Blocked)'].idxmax()]"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
